package com.css.prompt.model;

import java.time.LocalDate;
import java.util.List;

import jakarta.persistence.CollectionTable;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.Lob;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "my_prompts")
public class MyPrompt {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String title;

    @Lob
    private String description;

    @Lob
    private String content;

    private String category;

    private String folder;

    private LocalDate date;

    private String author;
    
    @Lob
    private String roleName;

    private String email;
    
    @Column(nullable = false)
    private String version;
    
    @Builder.Default
    @Column(name = "is_latest")
    private Boolean isLatest = true;

    @ElementCollection
    @CollectionTable(name = "my_prompt_tags", joinColumns = @JoinColumn(name = "prompt_id"))
    @Column(name = "tag")
    private List<String> tags;
    
    
    @Lob
    private String base;
    
    @Lob
    private String reusePrefix;
    
    @Lob
    private String selenium;
    
    @Lob
    private String playwright;
    
    @Lob
    @Column(name = "`both`")
    private String both;
    
}

